var isShowing = false;

window.onPetEnter = function onPetEnter(){
    //console.log(111);
    $("#petImage").attr("src","./image/hover.png");
}

window.onPetLeave = function onPetLeave(){
    //console.log(222);
    if(!isShowing){
        $("#petImage").attr("src","./image/normal.png");
    }
    
}

window.onPetClick = function onPetClick(){
    isShowing = true;
    $("#searchArea").removeClass("invisible");
}

window.onHideBtnClick = function onHideBtnClick(){
    $("#searchArea").addClass("invisible");
    isShowing = false;
    $("#petImage").attr("src","./image/normal.png");
}

window.toText = function toText(text){
    $("#searchInputArea").val(text);
}

window.toSearch = function toSearch(){
    let searchString = $("#searchInputArea").val();
    //ajax请求
}

window.onChangeFunc = function onChangeFunc(){
    let searchString = $("#searchInputArea").val();
    console.log(searchString);
    //ajax请求
}